package com.haoyeteng.sxbd.modular.business.service.impl;

import com.haoyeteng.sxbd.modular.business.model.User;
import com.haoyeteng.sxbd.modular.business.dao.UserMapper;
import com.haoyeteng.sxbd.modular.business.service.IUserService;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author haoyeteng123
 * @since 2019-05-16
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public User getByUserName(String userName) {
		return userMapper.getByUserName(userName);
	}

	
	/**
	 * 用户列表查询
	 */
	@Override
	public List<Map<String, Object>> selectUsersAndAuth(Page<User> page, Integer authState, String userName) {
		return userMapper.selectUsersAndAuth(page, authState, userName);
	}

	@Override
	public List<Map<String, Object>> selectUserForCurve(int year) {
		return userMapper.selectUserForCurve(year);
	}

	/**
	 * 获取用户及认证信息
	 * @param params 参数
	 * @return Map
	 */
	@Override
	public Map<String,Object> selectUsersAndAuthByUserId(Map<String,Object> params){
		return this.baseMapper.selectUsersAndAuthByUserId(params);
	}


	@Override
	public List<Map<String, Object>> selectUserForCurveByDay() {
		return this.baseMapper.selectUserForCurveByDay();
	}


	@Override
	public List<Map<String, Object>> selectUserForCurveByMonth() {
		return this.baseMapper.selectUserForCurveByMonth();
	}


	@Override
	public List<Map<String, Object>> selectUserForCurveByYear() {
		return this.baseMapper.selectUserForCurveByYear();
	}

}
